// file: sample.js
module.exports = {
  summary: 'a rule to hack response',
  *beforeSendResponse(requestDetail, responseDetail) {
    if (requestDetail.url.indexOf('dis/getInfoById')>0) {
        const newResponse = responseDetail.response;
        console.log("***********************")
        console.log(responseDetail.response.body.toString())
        console.log("***********************")

      newResponse.body += '';

      return new Promise((resolve, reject) => {
        // setTimeout(() => { // delay
        //   resolve({ response: newResponse });
        // }, 5000);
          resolve({ response: newResponse });
      });
    }
  },
};